package org.gd.hellojson.jackson.tests;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonSetter;

/**
 * @author Gorhover
 * @version 1.0-SNAPSHOT
 * @since 2013-10-30 15:44
 */
@JsonAutoDetect
class User {

    private Integer id;
    private String name;

    @JsonProperty("ID")
    Integer getId() {
        System.out.println("getId()");
        return id;
    }

    @JsonSetter("ID")
    void setId(Integer id) {
        System.out.println("setId(Integer id)");
        this.id = id;
    }

    @JsonProperty("name")
    String getName() {
        System.out.println("getName()");
        return name;
    }

    @JsonSetter("name")
    void setName(String name) {
        System.out.println("setName(String name)");
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
